package com.otp.model.test.instance.dao.impl;

import java.util.List;

import org.appfuse.dao.hibernate.GenericDaoHibernate;

import com.otp.model.test.instance.dao.ItemDao;
import com.otp.model.test.template.Item;

public class ItemDaoHibernate extends GenericDaoHibernate<Item,Long> implements ItemDao {

	public ItemDaoHibernate(){
		super(Item.class);
	}

	public List<Item> getTestMapEntryByTemplate(String templateId)
			throws Exception {
		@SuppressWarnings("unchecked")
		List<Item> returnedList = getHibernateTemplate().find("from Item where fk2test_template=?", templateId);
		return returnedList;
	}

	public List<Item> getTestMapEntryBySection(String sectionId)
			throws Exception {
		@SuppressWarnings("unchecked")
		List<Item> returnedList = getHibernateTemplate().find("from Item where fk2test_section=?", sectionId);
		return returnedList;
	}

}
